/**
 * 
 */
package com.googlecode.xcarve.object;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * @author xinyun.d
 * 2014-7-7
 */
public class Header implements Serializable{
	private byte magic=0x12;
	private byte version = 0x1;
	private byte codecType;
	private int length;
	private Map<String,Object> attachment = new HashMap<String,Object>();
	
	public Header(){
		
	}
	 
	
	/**
	 * @return the magic
	 */
	public byte getMagic() {
		return magic;
	}

	/**
	 * @param magic the magic to set
	 */
	public void setMagic(byte magic) {
		this.magic = magic;
	}

	/**
	 * @return the code
	 */
	public byte getVersion() {
		return version;
	}
	/**
	 * @param code the code to set
	 */
	public void setVersion(byte version) {
		this.version = version;
	}
	/**
	 * @return the length
	 */
	public int getLength() {
		return length;
	}
	public byte getCodecType() {
		return codecType;
	}
	public void setCodecType(byte codecType) {
		this.codecType = codecType;
	}
	/**
	 * @param length the length to set
	 */
	public void setLength(int length) {
		this.length = length;
	}
	/**
	 * @return the attachment
	 */
	public Map<String, Object> getAttachment() {
		return attachment;
	}
	/**
	 * @param attachment the attachment to set
	 */
	public void setAttachment(Map<String, Object> attachment) {
		this.attachment = attachment;
	}
	
	 @Override
	    public String toString() {
		return "Header [crcCode=" + version + ",codecType="+codecType+", length=" + length+", attachment=" + attachment + "]";
	    }
}
